<%--
  Created by IntelliJ IDEA.
  User: YYW
  Date: 2020/5/29
  Time: 18:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<head><meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>请登录</title>
    <script src="./js/jquery.min.js"></script>
    <script src="./js/jquery.form.min.js"></script>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="http://www.magicalcoder.com/magicaldrag/assets/drag/ui/magicalcoder/1.1.0/magicalcoder.css" rel="stylesheet"/>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.3/json3.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/4.6.0/echarts.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/4.6.0/extension/dataTool.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js"></script>
    <script src="http://www.magicalcoder.com/assets/js/common.js"></script>
    <script src="http://www.magicalcoder.com/magicaldrag/assets/drag/ui/magicalcoder/1.1.0/magicalcoder.js"></script>
</head>
<body class="layui-form" style="background-color:#eee;padding: 20px;">
<div class="container" style="padding-left: 20%; padding-right: 20%;">
    <form method="post" action="./user/login" id="formLogin" onsubmit="return login();">
        <h1 class="h3 mb-3 font-weight-normal">请登录</h1>
        <input class="form-control" name="email" type="email" placeholder="请输入您的邮箱" required/>
        <input class="form-control" name="password" type="password" placeholder="请输入您的密码" origin-type="password" required/>
        <div class="form-check form-check-inline">
        <label class="form-check-label">
            <input class="form-check-input" name="remember" type="checkbox" value="1" />记住我
        </label>
    </div>
        <a class="float-sm-right text-info" href="setNewPassword.jsp" draggable="false">忘记密码</a>
        <button class="btn btn-lg btn-primary btn-block" type="submit">登录</button>
        <p class="mt-5 mb-3 text-muted text-sm-right">
            还没有账号，<a class="text-info" href="register.jsp" draggable="false">立即注册</a>
        </p>
    </form>
</div>
<script type="text/javascript">
    function login() {
        $("#formLogin").ajaxSubmit({
            success:function (result) {
                var data = eval(result);
                if (data){
                    location.replace("./index.jsp");
                } else {
                    alert("登录失败");
                }
            }
        });
        return false;
    }




</script>
</body>
</html>
